﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_MasterPages/layout.Master" AutoEventWireup="true" CodeBehind="RSInvoiceReport.aspx.cs" Inherits="mojoPortal.Web.RS.SBM.RSInvoiceReport" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%@ Register Src="controls/locationheadercontrol.ascx" TagName="LocationHeaderControl" TagPrefix="uc1" %>
<%@ Register Src="~/rs/controls/modaliframecontrol.ascx" TagName="ModalIFrameControl" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="leftContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">

<uc1:LocationHeaderControl ID="ucLocationHeaderControl" runat="server"/>

<asp:UpdatePanel ID="upnlEstimateReport" runat="server">
<ContentTemplate>

<table>
<tr>
<td valign="top" nowrap>InvoiceID:</td>
<td>
    <asp:DropDownList ID="ddlInvoiceId" runat="server" AppendDataBoundItems="True" AutoPostBack="true" Width="130px" OnSelectedIndexChanged="ddlInvoiceId_SelectedIndexChanged">
    <asp:ListItem Text="< Please Select >" Value=""></asp:ListItem>
    </asp:DropDownList>
    &nbsp;&nbsp;
    <asp:Button ID="btnRunAdHocReport" runat="server" Text="Email Invoice" OnClick="btnRunAdHocReport_Click"/>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required" ControlToValidate="ddlInvoiceId" ForeColor="Red" ></asp:RequiredFieldValidator>          
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="btnReturn" runat="server" Text="Return" OnClick="btnReturn_Click"/>
</td>
</tr>
</table>
    <div>
    <table width="100%">
    <tr>
        <td>
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="800px" 
            Width="100%" Font-Names="Verdana" Font-Size="8pt" 
               WaitMessageFont-Names="Verdana" 
                WaitMessageFont-Size="14pt">
                <LocalReport ReportPath="RS\AppData\SBM\Reports\RDLC\RSInvoiceReport.rdlc">
                    <DataSources>
                        <rsweb:reportdatasource name="vwWorkOrderInvoice" 
                            DataSourceId="vwWorkOrderInvoiceDataObjectDataSource" />
                        <rsweb:reportdatasource name="vwWorkOrderInvoiceItem" 
                            DataSourceId="vwWorkOrderInvoiceItemDataObjectDataSource" />
                        <rsweb:reportdatasource name="tblCompany"
                            DataSourceId="tblCompanyObjectDataSource" />                                                                                                         
                    </DataSources>
                </LocalReport>
            </rsweb:ReportViewer>
        
        </td>
    </tr>
    </table>


    <asp:ObjectDataSource ID="vwWorkOrderInvoiceDataObjectDataSource" runat="server" 
                OldValuesParameterFormatString="original_{0}" 
                SelectMethod="GetDataWorkOrderInvoice" 
                TypeName="mojoPortal.Web.RS.AppData.SBM.Reports.RSBillingDatasetTableAdapters.vw_WorkOrderInvoiceTableAdapter" 
                OnObjectCreated="ObjectDataSource_OnObjectCreated" >
        <SelectParameters>
            <asp:Parameter Name="CompanyId" Type="Int64" />
            <asp:Parameter Name="InvoiceId" Type="Int64" />
            <asp:Parameter Name="WorkOrderId" Type="Int64" />
        </SelectParameters>
    </asp:ObjectDataSource>      
    <asp:ObjectDataSource ID="vwWorkOrderInvoiceItemDataObjectDataSource" runat="server" 
                OldValuesParameterFormatString="original_{0}" 
                SelectMethod="GetDataWorkOrderInvoiceItem" 
                TypeName="mojoPortal.Web.RS.AppData.SBM.Reports.RSBillingDatasetTableAdapters.vw_WorkOrderInvoiceItemTableAdapter" 
                OnObjectCreated="ObjectDataSource_OnObjectCreated" >
        <SelectParameters>
            <asp:Parameter Name="companyid" Type="Int64" />
            <asp:Parameter Name="workorderid" Type="Int64" />
        </SelectParameters>
    </asp:ObjectDataSource>       
    <asp:ObjectDataSource ID="tblCompanyObjectDataSource" runat="server" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetCompanyData" 
                TypeName="mojoPortal.Web.RS.AppData.SBM.Reports.RSBillingDatasetTableAdapters.rs_tblCompanyTableAdapter"
                OnObjectCreated="ObjectDataSource_OnObjectCreated" >
        <SelectParameters>
            <asp:Parameter Name="CompanyId" Type="Int64" />
        </SelectParameters>
    </asp:ObjectDataSource>
      
       
    </div>

<uc1:ModalIFrameControl ID="ucModalIFrameControl" runat="server"/>

</ContentTemplate>
</asp:UpdatePanel>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="rightContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="pageEditContent" runat="server">
</asp:Content>
